﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Classified/Cld-Menu.master" AutoEventWireup="true" CodeFile="Cld-Post-Ad.aspx.cs" Inherits="Post_Ad" %>
<%@ Register Src="~/Classified/UserControls/Cld-SearchControl.ascx" TagName="Search" TagPrefix="control" %>
<%@ Register Src="~/Classified/UserControls/Cld-SideAdControl.ascx" TagName="SideAd" TagPrefix="control" %>
<%@ Register Src="~/UserControls/User-Login.ascx" TagName="Login" TagPrefix="control" %>
<asp:Content ID="Content1" ContentPlaceHolderID="headSubMaster" Runat="Server">
 
 <script type="text/javascript" language="javascript">

     $(document).ready(function () {
         $("#<%=chkFeaturedAd.ClientID %>").click(
            function () {
                if ($("#<%=chkFeaturedAd.ClientID %>").is(":checked")) {
                    var value1 = $('#<%=hdnFeatured.ClientID %>').val()
                    if (value1 > 0) {
                    }
                    else {
                        alert('You do not have sufficient FeaturedAd balance.');
                    }
                }
            }
          );

            $("#<%=chkTopAd.ClientID %>").click(
            function () {
                if ($("#<%=chkTopAd.ClientID %>").is(":checked")) {
                    var value1 = $('#<%=hdnTop.ClientID %>').val()
                    if (value1 > 0) {
                    }
                    else {
                        alert('You do not have sufficient TopAd balance.');
                    }
                }
            }
          );

            $("#<%=chkHomepageGallery.ClientID %>").click(
            function () {
                if ($("#<%=chkHomepageGallery.ClientID %>").is(":checked")) {
                    var value1 = $('#<%=hdnHomepage.ClientID %>').val()
                    if (value1 > 0) {
                    }
                    else {
                        alert('You do not have sufficient Home page gallery balance.');
                    }
                }
            }
          );

     });

  </script>

 <script type="text/javascript">

 
   

    function GetDynamicFileUpload() {
        return ' <div class="registerion_row registerion_row_none"><div class="registerion_row_left mt3px">Upload Image</div>' +
        '<div class="registerion_row_right"><input name = "ImageFileUpload"  type="file"  onchange="return checkFileExtension(this);"/>' +
        '  <input class="w60px" type="button" value="Remove" onclick = "RemoveFileUpload(this)" /> </div></div>'
    }
    var upload_number = 0;
    function AddFileUpload() {
            var div = document.createElement('DIV');
            div.innerHTML = GetDynamicFileUpload("");
            document.getElementById("divFileUpload").appendChild(div);
    }

    function RemoveFileUpload(div) {
        document.getElementById("divFileUpload").removeChild(div.parentNode.parentNode.parentNode);
        upload_number--;
    }

    //Adding dynamic video textboxes
    var vid = 0;  
    function GetDynamicTextBox(value) { 
        return ' <div class="registerion_row registerion_row_none"><div class="registerion_row_left mt3px">You Tube Video Path</div>' +
        '<div class="registerion_row_right"><input name = "VideoTextBox"  type="text" value = "' + value + '" Class="input115px input345px"/>' +
        '  <input class="w60px" type="button" value="Remove" onclick = "RemoveTextBox(this)" /> </div></div>'
    }
    function AddTextBox() {
        var VideoLimit = 5;
        if (vid < VideoLimit) {
            var div = document.createElement('DIV');
            div.innerHTML = GetDynamicTextBox("");
            document.getElementById("divVideos").appendChild(div);
            vid++;
        }
        else {
            alert("Sorry you can not upload more than " + VideoLimit);
        }
    }

    function RemoveTextBox(div) {
        document.getElementById("divVideos").removeChild(div.parentNode.parentNode.parentNode);
        vid--;
    }

 </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_SubMaster" Runat="Server">
      <div class="clear"></div>
    
    <section>
    <div class="left_column">

    <asp:HiddenField ID="hdnFeatured" runat="server" />
    <asp:HiddenField ID="hdnTop" runat="server" />
    <asp:HiddenField ID="hdnHomepage" runat="server" />

    <div class="product_row_large">
          <h1>Ad Details</h1>
          <div class="pl10px">
              <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
              <ContentTemplate>
         
         <div class="registerion_row registerion_row_none">
              <div class="registerion_row_left mt3px">Category<span class="redstar">*</span></div>
              <div class="registerion_row_right">
                  <asp:DropDownList ID="ddlCategory" CssClass="droupdownlist dropdownarrowstyle"  AutoPostBack="true"
                      Width="357" runat="server" 
                      onselectedindexchanged="ddlCategory_SelectedIndexChanged">
                  </asp:DropDownList>
                <div class="listbox_icon_profile"></div> 
         	  </div>
         </div>

         <div class="registerion_row registerion_row_none">
              <div class="registerion_row_left mt3px">Sub Category<span class="redstar">*</span></div>
              <div class="registerion_row_right">
                  <asp:DropDownList ID="ddlSubCategory" CssClass="droupdownlist dropdownarrowstyle" Width="357" runat="server" AppendDataBoundItems="true">
                  <asp:ListItem Text="Select" Value="0"></asp:ListItem>
                  </asp:DropDownList>
                <div class="listbox_icon_profile"></div> 
         	  </div>
         </div>

         </ContentTemplate></asp:UpdatePanel>

             <div class="registerion_row registerion_row_none">
              <div class="registerion_row_left mt3px">Ad Title <span class="redstar">*</span></div>
              <div class="registerion_row_right">
                <ul>
                   <li><asp:TextBox ID="txtTitle" CssClass="input115px input345px" runat="server"></asp:TextBox></li>
                   <%--<li><asp:CheckBox ID="CheckBox1" runat="server" /> Featured</li>--%>                  
                </ul>
         	  </div>
         </div>     
          <div class="registerion_row registerion_row_none">
              <div class="registerion_row_left mt3px">Upload Image <span class="redstar">*</span></div>
              <div class="registerion_row_right">
                  <asp:FileUpload ID="FileUpload1" runat="server"    onchange="return checkFileExtension(this);"/>
                  <input class="w80px" type="button" value="Add More" onclick = "AddFileUpload()"  />
         	  </div>
         </div>
         <div id="divFileUpload"></div>
       <%--  <div class="registerion_row registerion_row_none">
              <div class="registerion_row_left mt3px">You Tube Video link</div>
              <div class="registerion_row_right">
                <asp:TextBox ID="txtVideo" CssClass="input115px input345px" runat="server"></asp:TextBox>
                  <input class="w80px" type="button" value="Add More" onclick = "AddTextBox()"  />
         	  </div>
         </div>

         <div id="divVideos"></div>--%>
         <div class="registerion_row registerion_row_none">
              <div class="registerion_row_left mt3px">State<span class="redstar">*</span></div>
              <div class="registerion_row_right">
                <asp:TextBox ID="txtState" CssClass="input115px input345px" runat="server"></asp:TextBox>
         	  </div>
         </div>

      <%--   <div class="registerion_row registerion_row_none">
              <div class="registerion_row_left mt3px">Country<span class="redstar">*</span></div>
              <div class="registerion_row_right">
                  <asp:DropDownList ID="ddlCountry" CssClass="droupdownlist dropdownarrowstyle"  Width="357" runat="server">
                  </asp:DropDownList>
                <div class="listbox_icon_profile"></div> 
         	  </div>
         </div>--%>

         <div class="registerion_row registerion_row_none">
              <div class="registerion_row_left mt3px">Landmark</div>
              <div class="registerion_row_right">
                <asp:TextBox ID="txtLocal" CssClass="input115px input345px" runat="server"></asp:TextBox>
         	  </div>
         </div>

         
       
         <div class="registerion_row registerion_row_none">
              <div class="registerion_row_left mt3px">Description <span class="redstar">*</span></div>
              <div class="registerion_row_right">
              
                <asp:TextBox ID="txtDescription" CssClass="input115px input345px" runat="server" 
                      Height="188px" TextMode="MultiLine" Width="474px"></asp:TextBox>
         	  </div>
         </div>
         
       
    <asp:ImageButton ID="ImageButton1" ImageUrl="~/images/submitb.jpg" class="mt20px submitbutton" 
                   runat="server" onclick="ImageButton1_Click" />
    &nbsp;&nbsp;<asp:Label ID="lblMsg" runat="server" CssClass="password pb10px" Font-Bold="true" ForeColor="Red" EnableViewState="false"></asp:Label>
     <div class="clear"></div>          
      </div>
      <div class="clear"></div>
        </div>
   
     
     <div class="product_row_large hide">
          <h1 class="normalh1"><span class="bold">Promote</span> My Ad (optional)</h1>
          <div class="pl10px">        
        <div class="registerion_row registerion_row_none">              
              <div class="registerion_row_right ml20px">
            <ul>
                <li><asp:CheckBox ID="chkFeaturedAd" runat="server" /> Featured Ad <a href="#" class="password">(Learn more)</a>  $24.99 </li>
                <li>Sell faster by putting your Ad in the Top Ads section located above all other Ads.</li>
                <li><asp:CheckBox ID="chkTopAd" runat="server" /> Top Ad <a href="#" class="password">(Learn more)</a>  $24.99 </li>
                <li>Sell faster by putting your Ad in the Top Ads section located above all other Ads.</li>
                <li><asp:CheckBox ID="chkHomepageGallery" runat="server" /> Homepage Gallery<a href="#" class="password">(Learn more)</a>  $24.99 </li>
                 <li>Sell faster by putting your Ad in the Top Ads section located above all other Ads.</li>
            </ul>
          </div>
            </div>            
         
         <div class="ml20px">
    
    <p>By posting your ad, you're agreeing to our terms of use, privacy policy and site policies.</p>
    <p>Please do not post duplicate ads. Use 'Promote My Ad' above to gain more replies.</p>
    </div>

	 </div>
  </div> </div>
      <div class="right_column"> 
      
    <control:Login ID="Login1" runat="server" />

        <control:SideAd ID="sideAd" runat="server" />

  </div>
      <div class="clear"></div>
      </section>
</asp:Content>

